﻿<%@ Page Title="App Details" Language="vb" AutoEventWireup="false" MasterPageFile="~/Site.Master" CodeBehind="AppsDetail.aspx.vb" Inherits="iRateMyApps.AppsDetail" %>

<asp:Content ID="Content2" ContentPlaceHolderID="FeaturedContent" runat="server">
    
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="MainContent" runat="server">
     
    <asp:Repeater ID="TitleRepeater" runat="server" DataSourceID="SqlDataSource2">
        <ItemTemplate><h2>Details for : <i><%# Eval("AppName") %></i></h2></ItemTemplate>
    </asp:Repeater>
        <asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:AppsDatabaseConnectionString %>" ProviderName="<%$ ConnectionStrings:AppsDatabaseConnectionString.ProviderName %>" SelectCommand="SELECT [AppName] FROM [AppsDatabase] WHERE ([ID] = ?)">
            <SelectParameters>
                <asp:QueryStringParameter Name="ID" QueryStringField="ID" Type="Int32" />
            </SelectParameters>
        </asp:SqlDataSource>
        <br />
    
    <p>
        <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataSourceID="SqlDataSource1">
            <Columns>
                <asp:BoundField DataField="Description" HeaderText="Description" SortExpression="Description" >
                <ItemStyle HorizontalAlign="Justify" Width="400px" Wrap="True" />
                </asp:BoundField>
                <asp:BoundField DataField="Review" HeaderText="Review" 
                    SortExpression="Review" >
                <HeaderStyle Width="100px" />
                <ItemStyle HorizontalAlign="Justify" Width="200px" />
                </asp:BoundField>
                <asp:TemplateField HeaderText="Rating">
                    <ItemTemplate>
                        <img src='<%# getRating(Eval("UserRating")) %>'  alt="No picture found" width="90"  height="23"/>
                    </ItemTemplate>
                    <HeaderStyle HorizontalAlign="Justify" />
                    <ItemStyle Width="100px" />
                </asp:TemplateField>
                <asp:ImageField DataImageUrlField="Pictures" HeaderText="Pictures">
                    <ControlStyle BorderStyle="Double" Height="150px" Width="200px" />
                    <ItemStyle Width="200px" />
                </asp:ImageField>
            </Columns>
        </asp:GridView>
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
            ConnectionString="<%$ ConnectionStrings:AppsDatabaseConnectionString %>" 
            ProviderName="<%$ ConnectionStrings:AppsDatabaseConnectionString.ProviderName %>" 
            SelectCommand="SELECT [ID], [AppName], [Description], [Review], [UserRating], [Type], [DeveloperName], [Pictures] FROM [AppsDatabase] WHERE ([ID] = ?)">
            <SelectParameters>
                <asp:QueryStringParameter Name="ID" QueryStringField="ID" Type="Int32" />
            </SelectParameters>
        </asp:SqlDataSource>
    </p>
    <p>
    </p>
</asp:Content>
